<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%><%@taglib
	uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Update Book Cover</title>
	<meta  charset="UTF-8" />
	<link href="css/style.css" rel="stylesheet" type="text/css" />
	<!--[if IE 6]>
		<link href="css/ie6.css" rel="stylesheet" type="text/css" />
	<![endif]-->
	<!--[if IE 7]>
        <link href="css/ie7.css" rel="stylesheet" type="text/css" />  
	<![endif]-->
	<style type="text/css">
		.menu-head{
			margin-left:10px;
			font-size:15px; 
			color:white;
		}
	</style>
</head>

<body>
	  <div id="background">
			  <div id="page">
			
					 <div class="header">
						<div class="footer">
							<div class="body">
							  
							  	<!-- include Menu -->
									<jsp:include page="Menu.jsp" flush="True">
										<jsp:param name="page_call"  value="AdminPage"/>
									</jsp:include>
									
									<div id="content" >
									
									    <img src="images/cotton-flower.jpg" width="726" height="546" alt="" title="">
										
										<div class="pagetitlebar">Admin page
											<span class="menu-head">
												<a href="AdminPage.jsp">หน้าแรก admin</a> |
												<a href="AdminBookList.jsp">ประเภทหนังสือ</a> |
												<a href="AdminBookList.jsp">จัดการรีวิวหนังสือ</a> |
												<a href="AdminBookList.jsp">จัดการข่าว</a>
											</span>
										</div>
										<div class="pagecontent">
											<form name="formAddBook"method="post"  enctype="multipart/form-data" action="AddBookCover.do">							
												<table>												
													<tr>
														<td colspan="2"><b>รายละเอียดหนังสือ</b></td>
													</tr>
													<sql:setDataSource dataSource="jdbc/sharewithme" var="sharewithme" />
													<c:catch var="ex2">
														<sql:query var="book" dataSource="${sharewithme}">
															select 	BISBN, BNameThai, BNameEng, BWriter, BPublishing, BEdition, BTranslate, BPrice, BTypeID, BCountPage
															from 	tbbooks 
															where 	BISBN='${param.isbn}'
														</sql:query>
													</c:catch>
													
													<tr>
														<td align="right">ISBN:</td>
														<td><b>${book.rows[0].BISBN }</b><input type="hidden" name="isbn" value="${book.rows[0].BISBN }"><input type="hidden" name="oldISBN" value="${book.rows[0].BISBN }"></td>
													</tr>
													<tr>
														<td align="right">ชื่อหนังสือภาษาไทย:</td>
														<td>${book.rows[0].BNameThai }</td>
													</tr>
													<tr>
														<td align="right">ภาพประกอบ:</td>
														<td><input type="file" name="coverImage"></td>
													</tr>												
													<tr>
														<td align="right"></td>
														<td>
															<input type="button" name="buttonSave" value="Save" onclick="formAddBook.submit()">
															<input type="button" name="buttonCancel" value="Cancel" onclick="frmBack.submit()">
														</td>
													</tr>
												</table>
											
										</form>		
										<form name="frmBack" method="post" action="AdminBookList.jsp">
											<input name="bookType" type="hidden" value="${book.rows[0].BTypeID}">
										</form>

							</div>
									
									</div>
									
									
						</div>
					 </div>
					 <div class="shadow">&nbsp;</div>
			  </div>    
	  </div>    
	</div>
	
	<form name="test">
		
	</form>
	<script type="text/javascript">
	function submitform(clickbutton)
	{
		var myTextField = document.getElementById('tt');
		myTextField.value = clickbutton;
		
	}
	</script>
</body>
</html>